// 游戏配置常量
export const GameConfig = {
    // 画布尺寸
    CANVAS_WIDTH: 1200,
    CANVAS_HEIGHT: 740,
    
    // 游戏区域划分
    IRAN_AREA_WIDTH: 150,
    SEA_AREA_WIDTH: 700,
    DEFENSE_AREA_WIDTH: 350,
    
    // 防御网格配置
    DEFENSE_GRID_ROWS: 7,
    DEFENSE_GRID_COLS: 5,
    DEFENSE_GRID_SIZE: 50,
    
    // 游戏性能配置
    TARGET_FPS: 60,
    MAX_DELTA_TIME: 1000 / 30, // 最大帧时间(30fps)
    
    // 初始游戏状态
    INITIAL_MONEY: 500000,
    INITIAL_WAVE: 1,
    MAX_WAVES: 10,
    
    // 地形高度配置
    TERRAIN_HEIGHT: {
        SEA_LEVEL: 0,
        URBAN_GROUND: 20,
        BUILDING_ROOF: 50,
        HIGH_POINT: 100
    },
    
    // 防御系统配置
    DEFENSE_SYSTEMS: {
        IRON_DOME: {
            cost: 500000,
            maintenance: 10000,
            range: [180, 250], // 🔧 增加射程
            accuracy: [85, 95],
            cooldown: 1500, // 🔧 减少冷却时间 
            name: '铁穹系统'
        },
        ARROW_3: {
            cost: 2000000,
            maintenance: 80000,
            range: [400, 550], // 🔧 增加射程
            accuracy: [95, 98],
            cooldown: 6000, // 🔧 减少冷却时间
            name: '箭-3系统'
        },
        GREEN_PINE_RADAR: {
            cost: 800000,
            maintenance: 20000,
            range: 1200, // 全屏
            supportRange: 150,
            accuracyBonus: 15,
            name: '绿松雷达'
        }
    },
    
    // 导弹配置
    MISSILES: {
        FATEH_110: {
            health: 100,
            horizontalSpeed: 180, // 提高速度
            diveSpeed: 280,
            damage: 150,
            flightTime: 120000,
            name: 'Fateh-110'
        },
        SHAHAB_3: {
            health: 120,
            horizontalSpeed: 150, // 提高速度
            diveSpeed: 250,
            damage: 300,
            flightTime: 180000,
            name: 'Shahab-3'
        },
        FATTAH_2: {
            health: 150,
            cruiseSpeed: 350, // 超音速
            attackSpeed: 450,
            damage: 500,
            flightTime: 45000,
            name: 'Fattah-2'
        },
        SHAHED_136: {
            health: 50,
            cruiseSpeed: 120, // 提高无人机速度
            attackSpeed: 180,
            damage: 100,
            flightTime: 240000,
            name: 'Shahed-136'
        },
        QIAM_1: {
            health: 80,
            horizontalSpeed: 200, // 提高速度
            diveSpeed: 300,
            damage: 120,
            flightTime: 90000,
            name: 'Qiam-1'
        },
        ZELZAL_2: {
            health: 110,
            horizontalSpeed: 160, // 提高速度
            diveSpeed: 280,
            damage: 250,
            flightTime: 150000,
            name: 'Zelzal-2'
        }
    },
    
    // 颜色配置
    COLORS: {
        // 以色列防御方
        ISRAEL_PRIMARY: '#2E86AB',
        ISRAEL_SECONDARY: '#A23B72',
        ISRAEL_ACCENT: '#F18F01',
        
        // 伊朗攻击方
        IRAN_PRIMARY: '#C73E1D',
        IRAN_SECONDARY: '#7B2D26',
        IRAN_ACCENT: '#FFB627',
        
        // 环境色
        MEDITERRANEAN: '#87CEEB',
        DESERT: '#D2B48C',
        URBAN_GRAY: '#708090',
        
        // UI色彩
        SUCCESS: '#28a745',
        WARNING: '#ffc107',
        DANGER: '#dc3545',
        INFO: '#17a2b8'
    },
    
    // 音效配置
    AUDIO: {
        MASTER_VOLUME: 0.7,
        SFX_VOLUME: 0.8,
        MUSIC_VOLUME: 0.5,
        
        // 程序化音效参数
        MISSILE_LAUNCH_FREQ: 800,
        INTERCEPT_SUCCESS_FREQ: 1200,
        BUILDING_DAMAGE_FREQ: 200,
        ALERT_FREQ: 600
    },
    
    // 调试配置
    DEBUG: {
        ENABLED: true,
        SHOW_FPS: true,
        SHOW_COLLISION_BOXES: true, // 显示碰撞框，包括射程圈
        SHOW_TRAJECTORY: true,
        LOG_LEVEL: 'info'
    }
};

// 类型定义
export type DefenseSystemType = keyof typeof GameConfig.DEFENSE_SYSTEMS;
export type MissileType = keyof typeof GameConfig.MISSILES;
export type TerrainHeight = keyof typeof GameConfig.TERRAIN_HEIGHT;
